package com.mxpio.erp.common.plan.service;

import com.mxpio.erp.common.enums.CommonEnums;
import com.mxpio.erp.common.plan.entity.OrganizationDemandLine;
import com.mxpio.erp.common.plan.entity.SalePredictionLine;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.mxpio.erp.common.enums.OrderStatusEnums.BpmnStatus;
import com.mxpio.erp.common.plan.entity.MpsVersion;
import com.mxpio.erp.common.sales.entity.SalesOrderLine;
import com.mxpioframework.common.vo.Result;
import com.mxpioframework.jpa.query.Criteria;
import com.mxpioframework.system.service.BaseService;
import org.springframework.transaction.annotation.Transactional;

public interface MpsVersionService extends BaseService<MpsVersion> {

	Boolean saveOnCheck(MpsVersion mpsVersion);

	Page<SalesOrderLine> poLinePageWithoutMps(Pageable page, Criteria criteria,String versionCode);

	@Transactional(readOnly = true)
	Page<SalesOrderLine> poLinePage(Pageable page, Criteria criteria);

	Result<MpsVersion> updateBpmnStatus(MpsVersion mpsVersion, BpmnStatus bpmnStatus);

    @Transactional(readOnly = true)
    Page<OrganizationDemandLine> odLinePageWithoutMps(Pageable page, Criteria criteria,String versionCode);

    @Transactional(readOnly = true)
    Page<SalePredictionLine> spLinePageWithoutMps(Pageable page, Criteria criteria, String versionCode);

    Page<OrganizationDemandLine> odLinePage(Pageable page, Criteria criteria);

	@Transactional(readOnly = false)
	void copyToTemp(MpsVersion mpsVersion);

	Result<MpsVersion> updateEffectiveStatus(MpsVersion mpsVersion, CommonEnums.EffectiveStatus yes);
}
